home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Plug-In Power Pack for Netscape Communicator
/
Plug-In Power Pack for Netscape Communicator.iso
/
plugins
/
dataviews
/
include
/
vnsaved.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-08
|
20KB
|
565 lines
/*
* @(#)VNsaved.h 1.43 3/16/95 16:12:03
*/
#ifndef VNSAVED_H
#define VNSAVED_H
#include "VUtextarray.h"
/* IH events */
#define V_DONE_EVENT 1
#define V_CANCEL_EVENT 2
#define V_RESTORE_EVENT 3
#define V_CLEAR_EVENT 4
#define V_SCROLL_EVENT 5
#define V_UP_EVENT 6
#define V_DOWN_EVENT 7
#define V_LEFT_EVENT 8
#define V_RIGHT_EVENT 9
#define V_NORTH_EVENT 10
#define V_SOUTH_EVENT 11
#define V_EAST_EVENT 12
#define V_WEST_EVENT 13
#define V_NORTHEAST_EVENT 14
#define V_NORTHWEST_EVENT 15
#define V_SOUTHEAST_EVENT 16
#define V_SOUTHWEST_EVENT 17
#define V_HELP_EVENT 18
#define V_COPY_EVENT 19
#define V_CUT_EVENT 20
#define V_PASTE_EVENT 21
#define V_MODE_EVENT 22
#define V_MARK_EVENT 23
#define V_VSCROLL_EVENT 24
#define V_HSCROLL_EVENT 25
#define V_BUTTON_EVENT 26
#define V_UPDATE_EVENT 27
#define V_SET_HILITE_EVENT 28
/* Embedded IH actions (button, slider) */
#define V_ENTER_ACT 101
#define V_LEAVE_ACT 102
#define V_KEYPRESS_ACT 103
#define V_KEYRELEASE_ACT 104
#define V_VALUECHANGE_ACT 105
#define V_ACTIVATE_ACT 106
#define V_DEACTIVATE_ACT 107
#define V_SET_ACT 108
#define V_CLEAR_ACT 109
/* Embedded input type.
If the value of parent input does not influence visibility
of the child, it is considered static, otherwise dynamic.
Static ones get setup at V_OB_EVAL_DISPLAY_ENV_SET time and
drawn at the V_OB_EVAL_DRAW_STATIC time,
Dynamic children are always setup and drawn at the
V_OB_DRAW_DYNAMIC time.
*/
#define V_STATIC_CHILD 1
#define V_DYNAMIC_CHILD 2
/* IH item type */
#define V_TEXT_TYPE 0
#define V_OBJECT_TYPE 1
#define V_BUTTON_TYPE 2
#define V_DIRECT 1
#define V_REVERSED -1
#define PLIST_INCR 5
typedef struct
{
int n;
int n_busy;
ADDRESS (*list)[];
} PLIST;
typedef struct
{
OBJECT object;
int inum;
int action;
int dyn_type;
} CHILD;
struct DVmessage
{
int action; /* Action the embedded input provides */
int act; /* The cause of the message */
int Ivalue; /* Value associated with the embedded input */
double value;
double value2;
};
struct Paste
{
ADDRESS paste_sl; /* Cut/paste buffer: stringlist */
int paste_width; /* Height for RECT_MODE paste */
};
struct Ed
{
TA_PACKED_COLOR ed_normal_color; /* Normal text color */
TA_PACKED_COLOR ed_reversed_color; /* Highligted text color */
DV_BOOL ins_mode; /* Typing mode: insert/overwrite */
DV_BOOL help_mode; /* User have entered help_mode. Is used
on static manner.
We need this flag instead of checking
a current command handler because in
help_mode we can enter two_keys_command
mode or even marking mode. */
DV_BOOL mark_mode; /* User have entered markind_mode.
See comments for help_mode. */
/* No two_key_command_mode flag yet because this mode ends as soon as
you type the second (any) key. */
DV_BOOL marker; /* Indicates if marker is on
(marked area was set). */
int paste_mode; /* Indicates rectangle mode for
mark/cut/paste. */
struct Paste paste ; /* Paste buffer */
TEXTARRAY ta; /* Textarray */
TA_POSITION ta_curr_pos; /* Current cursor position in ta */
TA_POSITION ta_mstart_pos;/* Marker start position in ta */
TA_POSITION ta_mend_pos; /* Marker end position in ta */
short ta_height; /* Height of textarray */
short ta_width; /* Width of textarray */
ADDRESS sl; /* Stringlist */
int sl_curr_row; /* Current cursor row in sl */
int sl_curr_col; /* Current cursor col in sl */
int sl_mstart_row; /* Marker start row in sl.*/
int sl_mstart_col; /* Marker start col in sl */
int sl_mend_row; /* Marker end row in sl.*/
int sl_mend_col; /* Marker end col in sl */
int sl_mstart_buf_row; /* Buf. Marker start row in sl.*/
int sl_mstart_buf_col; /* Buf. Marker start col in sl */
int anch_row; /* Row of SL where the first row of
TA starts */
int anch_col; /* Col. of Sl where the first col. of
TA starts */
struct Ed * ed_buf; /* Place to save copy of curr. Ed state */
DV_BOOL (* mouse_handler)(); /* Current mouse handling func. */
DV_BOOL (* command_handler)(); /* Current command handling func. */
};
typedef struct
{
DV_BOOL TooSmallToDraw; /* Apperance: Preserving from clipping outside
for too small object when vp's are not valid
after shrinking. Only outline get drawn. */
DV_BOOL UpdateTooSmall; /* No update it update area is too small */
double NextValue; /* Last data value of the variable */
double CurrValue; /* The value the variable had before
the last value */
OBJECT
EraseColor; /* Color to use when erasing: stroke text for
slider, slider2D or marker for slider2D,
text for VNtext, item area for toggle and button,
check area for a checklist. */
OBJECT
Transform, /* All. Transform from layout to screen */
InObjects, /* combiner, multiplexor */
Item_deque, /* Menu, toggle, checklist */
Area_deque; /* Combiner, multiplexor, menu */
int
TotVars, /* combiner, multiplexor, checklist */
SavedTotVars, /* combiner, multiplexor, checklist */
NumItems, /* menu, multiplexor, checklist, toggle */
CurrItemValue, /* menu, multiplexor, checklist, toggle */
NextItemValue, /* menu, multiplexor, checklist, toggle */
CurrStartIndex, /* menu, multiplexor, checklist, toggle */
NextStartIndex, /* menu, multiplexor, checklist, toggle */
InitialStartIndex, /* menu, multiplexor, checklist, toggle */
NumValues, /* motif */
PostType, /* All. How to post events (Object/RectEdge). */
ItemType; /* Menu, toggle */
char ** Items, /* motif */
* IHname, /* All */
**ItemList; /* char** for menu or toggle, OBJECT* for
multiplexor */
double
InitialValue; /* Saved version of original value.
All but text, textedit */
float * Values; /* List of values, menu, toggle */
DV_BOOL
TemplateFlag, /* All. Template existance. */
EchoFlag, /* All. Echo as the input changes?*/
VNtype, /* All. Template type flag. */
Poll, /* All. Trace mouse move? */
Inherit, /* combiner, multiplexor */
MoveObjects, /* Menu, multiplexor, toggle, checklist */
Scroll; /* Scrolling enabled flag for multiplexor, menu, toggle,
checklist. Flag is this a scroll bar(YES) or a slider(NO)
for a slider. */
ADDRESS
Vdp, /* All */
*VarList, /* checklist, combiner, multiplexor */
*InitialList; /* combiner, multiplexor, checklist */
double
*OrgList, /* VNwmenu */
*OldList; /* VNwmenu */
EVENT_REQUEST out_req, /* Event request for outside polling,
menu, multi, button */
in_req; /* Event request for inside polling, button */
/* Data Structure used to save VNcombine information */
/* Data Structure used to save VNmenu/VNmultiplexor information (VNmenu.c) */
DV_BOOL
Border_flag,
Fill_flag,
Item_Echo,
LastValueEcho, /* Controls update/echo logic. */
MenuAsStatus, /* Controls an initial highlight */
MenuAsSlider; /* Controls slider-like behavior */
int
IH_type,
CurrSelValue,
NextSelValue,
NumAreas;
DV_POINT ItemSize; /* menu, multiplexor */
OBJECT StatusArea, /* Area to draw the last selected item for a menu
or an input object for a multiplexor */
StatusText, /* Text to use to draw the last selected item */
LayoutArea; /* Used to determine erase color */
/* Data Structure used to save VNcheck information */
DV_BOOL CheckDraw;
OBJECT
Check_areas,
Checkbox,
Check;
double
**CurrList,
**NextList,
**TempList;
/* Data Structure used to save VNpalette information */
DV_BOOL PaletteDraw; /* NO if palette area or slots are too small. */
OBJECT EchoObj, /* Rectangle object to echo the palette color. */
Echo_color;/* Color used to echo the palette value. */
RECTANGLE Pal_vp; /* Viewport containing the palette. */
DV_POINT Slot_size; /* The size of each color patch in the palette. */
int
color_xincr, /* The change in the color index that corresponds
| to moving from one column to the next in the palette. */
color_yincr, /* The change in the color index that corresponds
| to moving from one row to the next in the palette. */
num_columns, /* Number of columns in the palette, that is,
| the number of patches per row in the palette. */
num_rows; /* Number of rows of color patches in the palette.*/
/* Data Structure used to save VNslider information */
RECTANGLE
DigitsBox, /* Rectangle to draw digits in */
Page, /* Scroll bar area */
NotPageMore, /* Area above page or NotSlider area */
NotPageLess; /* Area below Page or Slider area */
int
SliderMin, /* Minimum slider coordinate */
SliderRange, /* Amount slider top can move */
SliderDirection, /* Is this a horizontal or vertical slider? */
Anchor; /* Position around which the scrolled area is drawn */
char
*LastValueString, /* Last value string */
*format; /* Format for displaying the data value */
OBJECT
ValueDisplay; /* Text object giving current value of data */
double
MinVal, /* Minimum value that the number is to have */
MaxVal, /* Maximum value that the number is to have */
IncrementVal, /* Increment to use for up and down buttons */
PageSize; /* Saved version of the initial value */
TIC_DATA *Tdp; /* Tick Descriptor, describes where tick marks would
| be if the slider were labelled. These tick marks are used
| to constrain the values associated with the slider. The slider
| will have the value associated with the nearest minor tick
| mark. */
/* Data Structure used to save VNslider2D information */
#define DIM 2 /* Slider2D number of vars */
RECTANGLE
DigitsBox_X, /* Rectangle to draw digits of x-coordinate in */
DigitsBox_Y; /* Rectangle to draw digits of y-coordinate in */
DV_POINT
xy, /* New xy position picked */
XY_Max, /* Maximum xy coordinate */
XY_Min, /* Minimum xy coordinate */
XY_Range, /* Amount xy can move */
SavedRasterAnchor; /* ll corner of the raster */
ADDRESS
SavedRaster; /* Raster behind icon */
LONG
EchoMarker; /* What to echo */
OBJECT
TextEraseColor_X, /* Color to use when erasing stroke text */
TextEraseColor_Y; /* Color to use when erasing stroke text */
DV_COORD
IconSize; /* Size of Icon in pixels */
double
NextXValue, /* Last X value */
NextYValue, /* Last Y value */
CurrXValue, /* Last X value */
CurrYValue, /* Last Y value */
MinX, /* Minimum value that the X number is to have */
MinY, /* Minimum value that the Y number is to have */
MaxX, /* Maximum value that the X number is to have */
MaxY, /* Maximum value that the Y number is to have */
X_Increment, /* Increment to use for up and down buttons */
Y_Increment, /* Increment to use for up and down buttons */
InitialXValue, /* Saved version of the initial value */
InitialYValue; /* Saved version of the initial value */
char
*LastValueStringX, /* Last value string */
*LastValueStringY, /* Last value string */
*formatX, /* Format for displaying the data value */
*formatY; /* Format for displaying the data value */
OBJECT
InvTransform, /* xy: Transform from screen to layout */
ValueXDisplay, /* Text object giving current value of data */
ValueYDisplay, /* Text object giving current value of data */
MarkerObject, /* Object to echo as marker in Slider2D.area */
LastXform; /* Last xform object used to draw the marker */
TIC_DATA *tdpX, *tdpY; /* Tick Descriptors, describe where tick marks
| would be if the slider were labelled. These tick marks are used
| to constrain the values associated with the slider. The slider
| will have the value associated with the nearest minor tick
| mark. */
#define vdpX vdp[0]
#define vdpY vdp[1]
ADDRESS
vdp[DIM];
int
EraseMethod; /* How to erase icon */
EVENT_REQUEST
poll, /* event request to for polling */
activate, /* event request to activate input object */
passivate, /* event request to passivate input object */
toggle; /* event request to toggle activation of input obj */
/* Data Structure used to save VNtoggle information */
DV_BOOL
WrapValue, /* Default: YES, means that the data is incremented
modulo NumItems (sawtooth function); NO means the
data bounces between the minimum and the maximum
(triangle func). */
GoingNext; /* YES means the data is incrementing with the picks;
NO means it is decrementing */
OBJECT Item_area;
/* Data structure used to save VNtext information */
DV_BOOL Edit_flag; /* Flag for inline editing of text */
DV_POINT StartPoint; /* Keeps coordinates of the lower left corner of the
character rectangle */
int
Carat_flag, /* Flag for type of carat(cursor) used to denote
current char */
Tindex, /* String index of carat/cursor character */
Tstart,/* String index of the first displayed character of the
string */
Tcurlen, /* Current length of the text string */
Pend_old, /* "Window" index of the previous last string character. */
Pindex_old, /* Previous position of the cursor in the "window". */
Vmaxchars, /* The maximum number of characters that will
fit in the string echo viewport */
TFcolor, TBcolor, /* Text foreground and background */
RedrawType; /* Depends on the type of the string change */
/* Next are used by both VNtext and VNtextedit */
DV_BOOL
Bell_flag, /* Flag for BELL when when an error is detected */
Flash_flag, /* Flag for flashing the text echo area if error */
Read_only_flag, /* Editing permission */
Direction, /* REVERSED for Arabic, hebrew, DIRECT the rest */
LocalDirection; /* To reverse direction temporarily */
int
ChIndex, /* Character size index */
Xchsize, Ychsize, /* Character size in pixels */
TmaxlenCurr, /* Current maximum length of text string allowed */
TmaxlenNext, /* Next maximum length of text string allowed
(used with delimited text) */
TmaxlenUpdate; /* Saved maximum length
(for delayed update after help)*/
char
Backspace, Deleteline, /* Terminal defined editing keys */
*InitialString, /* Copy of the string used for Restore and Cancel */
*StringCurr, /* Current data (buffer address) */
*StringNext; /* New data (pointer to the data string). To be freed
after use. */
/* Data Structure used to save VNtextedit information */
struct Ed * ed;
char * UpdateString, /* String used to keep the last update data at the
time update is frosen in help mode of textedit
*/
*StringRestore; /* Copy of the string used to recover from restore
(repeating restore toggles text back and force)
*/
V_UTA_CURSOR_ENUM Cursor_style;
TA_PACKED_COLOR Cursor_color;
/* Info about the current, previous and next cursor and anchor
positions. Is used to restore if length check fails */
int sl_curr_row,
sl_curr_col,
anch_curr_row,
anch_curr_col,
sl_next_row,
sl_next_col,
anch_next_row,
anch_next_col,
sl_old_row,
sl_old_col,
anch_old_row,
anch_old_col;
double Vslider_val, /* Vert. slider value */
Vslider_val_old, /* Last value of a vert. slider */
Hslider_val, /* Hor. slider value */
Hslider_val_old; /* Last value of a hor. slider */
OBJECT Vslider,
Hslider;
int ScrollOnUpdate;
/* Data Structure used to save VNnull information */
OBJECT VarnameText;
/* Data Structure used to save VNbutton information */
#define SD_DIM 6
DV_BOOL EraseFlag;
ADDRESS STDTable;
OBJECT Picture[SD_DIM];
int ButtonStateNext,
ButtonStateCurr;
/* Data structure used by widgets */
ADDRESS data; /* Pointer to X menu widget */
LONG widget; /* Top widget */
int CallbackLevel; /* Supresses recursive callbacks for widgets. */
double
DeltaVal, /* Difference between min and max values, VNwslider */
OldValue; /* VNwslider */
/* Embedded stuff for VNtextedit */
double Vincrement;
double Hincrement;
/***************************************************************
Next up to the end of the INPUT_OBJECT_SAVED_DATA structure
is just to make build happy. Remove this when widgets get
converted to a new IH tables.
****************************************************************/
RECTANGLE ClipVPused;
OBJECT it;
int LastStartIndex,
LastValue,
Tmaxlen;
char * StringLast;
} INPUT_OBJECT_SAVED_DATA;
typedef struct INPUT_OBJECT_GENERIC_DATA
{
RECTANGLE
WorldVP, /* World coordinates VP for the interaction handler */
ScreenVP, /* Screen coordinates VP for the interaction handler */
VPused; /* Actual screen viewport (drawn part of the input)
used by the interaction handler.
This is initially set by VOinDraw and MAY BE ADJASTED
BY AN INTERACTION HANDLER (VNmenu does it). */
ADDRESS SavedRaster; /* Address of the saved raster area */
RECTANGLE RedrawClipVP; /* Defines the vp to redraw input in. Used
only by VOinRedraw/ContextRedraw. */
RECTANGLE ClipVPused; /* Defines part of the input to draw/redraw.
Equels to the intersection of DI->VPused
and sdp->RedrawClipVP during Redraw,
and to DI->VPused for the rest
(Draw & Update) */
RECTANGLE EchoVP; /* Where the main echo is echoed. For example,
for a slider the main echo rectangle is the
slider rectangle as oppose to echoing digits. */
DRAW_ENV de; /* Keps draw environment used to draw inputs */
DV_BOOL did_update; /* Is set by IH if it produced some graphical
output. */
V_OB_EVAL_TYPE State; /* Indicates what the function from IH_table was
called */
int ServiceResult;
LONG ForeColorIndex,
BackColorIndex; /* Color indices of foreground and background
colors for the input object. If these values
are V_UNDEFINED use colors from the layout. */
OBJECT ForeColor, /* Input forecolor */
BackColor, /* Input backcolor */
ScrForeColor, /* Color to restore to after drawing */
ScrBackColor, /* Color to restore to after drawing */
SavedForeColor, /* Saved fprecolor of the screen to restore */
SavedBackColor; /* Saved backcolor of the screen to restore */
/* Embedded stuff */
OBJECT parent;
struct DVmessage message;
DV_BOOL SuppressVupdate;
DV_BOOL SuppressHupdate;
double Value;
int Rvalue; /* The last return value:
used for chaining service results */
OBJECT ActiveChildrenList;
} INPUT_OBJECT_GENERIC_DATA;
#endif /* VNSAVED_H */